@echo off  
setlocal enabledelayedexpansion  
  
:: Define the base storage and bootstrap directories  
set "BASE_DIR=%~dp0"  
set "STORAGE_DIR=%BASE_DIR%storage"  
set "BOOTSTRAP_DIR=%BASE_DIR%bootstrap"  
  
:: Create directories if they don't exist  
if not exist "%STORAGE_DIR%" mkdir "%STORAGE_DIR%"  
if not exist "%STORAGE_DIR%\app" mkdir "%STORAGE_DIR%\app"  
if not exist "%STORAGE_DIR%\framework" mkdir "%STORAGE_DIR%\framework"  
if not exist "%STORAGE_DIR%\views" mkdir "%STORAGE_DIR%\views"  
if not exist "%STORAGE_DIR%\framework\cache" mkdir "%STORAGE_DIR%\framework\cache"  
if not exist "%STORAGE_DIR%\framework\sessions" mkdir "%STORAGE_DIR%\framework\sessions"  
if not exist "%STORAGE_DIR%\framework\views" mkdir "%STORAGE_DIR%\framework\views"  
if not exist "%BOOTSTRAP_DIR%\cache" mkdir "%BOOTSTRAP_DIR%\cache"  
  
:: Generate a new application key for Laravel  
php "%BASE_DIR%artisan" key:generate  
  
echo Directories created and application key generated successfully!  
pause